﻿/* EntitiesToDTOs. Copyright (c) 2011. Fabian Fernandez.
 * http://entitiestodtos.codeplex.com
 * Licensed by Common Development and Distribution License (CDDL).
 * http://entitiestodtos.codeplex.com/license
 * Fabian Fernandez. 
 * http://www.linkedin.com/in/fabianfernandezb/en
 * */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntitiesToDTOs.Domain;

namespace EntitiesToDTOs.Helpers
{
    /// <summary>
    /// Manages operations relative to Warnings that this AddIn can raise
    /// </summary>
    internal class WarningsPool
    {
        /// <summary>
        /// List of actual warnings
        /// </summary>
        private static List<Warning> Warnings = new List<Warning>();


        /// <summary>
        /// Adds a Warning to the Pool
        /// </summary>
        /// <param name="warningMessage">Warning message</param>
        public static void AddWarning(string warningMessage)
        {
            WarningsPool.Warnings.Add(new Warning(warningMessage));
        }

        /// <summary>
        /// Gets the actual Warnings of the Pool
        /// </summary>
        /// <returns></returns>
        public static List<Warning> GetWarnings()
        {
            return WarningsPool.Warnings;
        }

        /// <summary>
        /// Removes all actual Warnings from the Pool
        /// </summary>
        internal static void ClearWarnings()
        {
            WarningsPool.Warnings.Clear();
        }
    }
}
